import {
  ANSWER_TYPE_ENUM,
  QUESTION_STYLE_ENUM,
  QUESTION_TYPE_ENUM,
  SURVEY_RESULT_STATUS_ENUM,
  SURVEY_STATUS_ENUM
} from '@CONSTANTS/survey'
import { CustomI18NITF } from '@INTERFACES/Common'
import { PatientITF } from '@INTERFACES/Patient'
import { PlanManagementITF } from '@INTERFACES/PlanManagement'
import { TagITF } from '@INTERFACES/Tag'

export interface DecisionFlowITF {
  p8Id: string;
  Introduction: CustomI18NITF;
  JourneyNumber: number;
  Title: CustomI18NITF;
}

export interface SurveyResultITF {
  p8Id: string;
  FeedItemTags: TagITF[];
  Patient: boolean;
  Result: CustomI18NITF;
  ResultDesc: CustomI18NITF;
  Status: SURVEY_RESULT_STATUS_ENUM;
  Tags: TagITF[];
  Template: SurveyITF[]
}

export interface SurveyITF {
  p8Id: string;
  Status: SURVEY_STATUS_ENUM;
  Title: CustomI18NITF;
  TitlePatient: CustomI18NITF;
  Description: CustomI18NITF;
  Basis: CustomI18NITF;
  Questions: QuestionITF[];
  PictureFileName: string;
  EstMinutes: number;
  ModifiedDate: number;
  ParticipantNumber: number;
  SurveyTemplateId?: string
  SurveyStatus?: SURVEY_STATUS_ENUM
}

export interface ChoiceITF {
  Label: string,
  Value: string,
  SubChoice?: boolean,
  Text: CustomI18NITF,
  SubChoices?: ChoiceITF[],
  NextNodeCode: string,
  Instruction: CustomI18NITF
}

export interface DecisionFlowQuestionITF {
  Question: CustomI18NITF,
  Choices: ChoiceITF[],
}

export interface SurveyQuestionITF {
  Code: number,
  Level: number,
  AnswerType: ANSWER_TYPE_ENUM,
  AnswerChoices: string | string[],
  AnswerChoice: ChoiceITF,
  Choices: ChoiceITF[],
  QuestionText: CustomI18NITF,
  QuestionType: QUESTION_TYPE_ENUM,
  QuestionStyle: QUESTION_STYLE_ENUM,
  Required: boolean,
}

export interface QuestionITF extends SurveyQuestionITF, DecisionFlowQuestionITF {

}

export interface EvaluationITF extends DecisionFlowITF, SurveyITF {
}

export interface EvaluationStartITF {
  p8Id: string;
  CreatedBy: string;
  CreatedDate: number;
  ModifiedBy: string;
  ModifiedDate: number;
  Patient: PatientITF;
  Template: EvaluationITF
}

export interface EvaluationResultITF {
  p8Id: string,
  Result: CustomI18NITF,
  ResultDesc: CustomI18NITF,
  Score: number,
  Templates?: PlanManagementITF[]
}
